A separation logic framework for HOL
نویسنده
چکیده
Separation Logic as introduced by Calcagno, O’Hearn, and Yang [7] is the foun-dation of the separation logic framework in HOL4. In the following, this foundation willbe described. 3.2.1 States and Predicates on States As the name suggests, Abstract Separation Logic is an abstract version of separationlogic. It abstracts from both the concrete specification and the concrete programming 62 CHAPTER 3. THEORETICAL FOUNDATION AND IMPLEMENTATION language. The programming language of Abstract Separation Logic manipulates someabstract states, the specification language is based on predicates on these states. 3.2.1.1 Separation Combinators Since nothing is known about these states, a partial function , called the separationcombinator, is used to combine states and define whether two states are separate. Definition 3.2.1 (Separation Combinator (HOL4-Thm 217)). A separation combinatoron a set of states Σ is a partially defined function : Σ Σ á Σ that satisfies the followingproperties: • is partially associative, i. e.s1, s2, s3. Definedps1 ps2 s3qq Definedpps1 s2q s3q^s1, s2, s3. Definedps1 ps2 s3qq ùñ ps1 ps2 s3q ps1 s2q s3q • is partially commutative, i. e.s1, s2. Definedps1 s2q Definedps2 s1q ^s1, s2. Definedps1 s2q ùñ ps1 s2 s2 s1q • is partially cancellative, i. e.s1, s2, s3. Definedps1 s2q ^ Definedps1 s3q ^ps1 s2 s1 s3q ùñ ps2 s3q• for all states s P Σ there exists a neutral element us P Σ with us s s HOL4 remark 3.2.2. HOL4 supports only total functions. In order to formalise separationcombinators, which are only partially defined, option-types are used. The value NONE isused to model undefined, whereas SOME(x) represents the defined value x. Definition 3.2.3 (Separateness, Substates, Superstates (HOL4-Thms 132, 133)). Thedefinition of separation combinators induces notions of separateness (#), substates( ̈)and superstates(©).s1 # s2 iff s1 s2 is defineds1 ̈ s3 iffDs2. s3 s1 s2s3 © s1 iff s1 ̈ s3
منابع مشابه
Types, Maps and Separation Logic
This paper presents a separation-logic framework for reasoning about low-level C code in the presence of virtual memory. We describe our abstract, generic Isabelle/HOL framework for reasoning about virtual memory in separation logic, and we instantiate this framework to a precise, formal model of ARMv6 page tables. The logic supports the usual separation logic rules, including the frame rule, a...
متن کاملA Separation Logic Framework in HOL
Separation Logic has proved to be a powerful technique for program verification. There are tools based on ideas of separation logic and even some implementations in theorem provers. However, these implementations all concentrate on the verification of programs written in one specific language. In contrast, I propose to build a framework inside the HOL theorem prover that concentrates on separat...
متن کاملA Separation Logic Framework for Imperative HOL
We provide a framework for separation-logic based correctness proofs of Imperative HOL programs. Our framework comes with a set of proof methods to automate canonical tasks such as verification condition generation and frame inference. Moreover, we provide a set of examples that show the applicability of our framework. The examples include algorithms on lists, hash-tables, and union-find trees....
متن کاملSemi-automatic Proofs about Object Graphs in Separation Logic
Published correctness proofs of garbage collectors in separation logic to date depend on extensive manual, interactive formula manipulations. This paper shows that the approach of symbolic execution in separation logic, as first developed by Smallfoot, also encompasses reasoning about object graphs given by the reachability of objects. This approach yields semi-automatic proofs of two central g...
متن کاملA Formalisation of Smallfoot in HOL
In this paper a general framework for separation logic inside the HOL theorem prover is presented. This framework is based on Abstract Separation Logic. It contains a model of an abstract, imperative programming language as well as an abstract specification logic for this language. While the formalisation mainly follows the original definition of Abstract Separation Logic, it contains some addi...
متن کاملA Deep Embedding of a Decidable Fragment of Separation Logic in HOL
Smallfoot is a tool to automatically check separation logic specifications of sequential programs. It uses a decidable fragment of separation logic. In this paper, a deep embedding of a slightly different decidable fragment of separation logic inspired by Smallfoot is presented. Moreover, a HOL implementation of a decision procedure for entailments in this logic is described. The main focus of ...
متن کامل